#!/usr/bin/python
#parses gap-spanning clones

import sys
import re

mummer_file = sys.argv[1]
mf = open(mummer_file, "rU")
mfl = mf.readlines()

left = re.compile('(\w+)_[L|left]')
right = re.compile('(\w+)_[R|right]')

ctgslist = []

for line in mfl[4:]:
    strand = ""
    l = line.split('\t')
    ctgstart = int(l[0])
    ctgstop = int(l[1])
    ctglen = int(l[7])
    readstart = int(l[2])
    readstop = int(l[3])
    ctgname = l[11]
    readname = l[12].rstrip()
    ctglist.append(ctgname)
    readlist.append((readname, ctgname, ctglen, ctgstart, ctgstop, readstart, readstop))

unique_ctgs = list(set(ctglist))



mf.close()
